package com.wxy.ej.flow;

import org.activiti.spring.boot.SecurityAutoConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@EnableAutoConfiguration(exclude={SecurityAutoConfiguration.class})
/*@SpringBootApplication(exclude = {
		org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
		org.activiti.spring.boot.SecurityAutoConfiguration.class
})*/
//@EnableEurekaClient
@EnableDiscoveryClient
@EnableFeignClients
@ComponentScan({
		"com.rt.easyjava.common.config",// dozer mymapper
		"com.rt.easyjava.common.aop", // aop log
		"com.rt.easyjava.common.exception", // controller exception
		"com.rt.easyjava.common.minio", // minio
		"com.rt.easyjava.common.email", // email
        "com.wxy.ej.flow"})
public class FlowApplication {

	public static void main(String[] args) {
		SpringApplication.run(FlowApplication.class, args);
	}

	@Resource
	private RestTemplateBuilder builder;

	@Bean
	@LoadBalanced
	RestTemplate restTemplate() {
		return builder.build();
	}

}
